package model

import "github.com/zeromicro/go-zero/core/stores/sqlx"

var _ PoetryModel = (*customPoetryModel)(nil)

type (
	// PoetryModel is an interface to be customized, add more methods here,
	// and implement the added methods in customPoetryModel.
	PoetryModel interface {
		poetryModel
		withSession(session sqlx.Session) PoetryModel
	}

	customPoetryModel struct {
		*defaultPoetryModel
	}
)

// NewPoetryModel returns a model for the database table.
func NewPoetryModel(conn sqlx.SqlConn) PoetryModel {
	return &customPoetryModel{
		defaultPoetryModel: newPoetryModel(conn),
	}
}

func (m *customPoetryModel) withSession(session sqlx.Session) PoetryModel {
	return NewPoetryModel(sqlx.NewSqlConnFromSession(session))
}
